Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@ jobs:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v3
- name: Install macOS dependencies
if: matrix.os == 'macos-latest'
run: |
brew install cairo libxml2 libffi
echo "PKG_CONFIG_PATH=/opt/homebrew/lib/pkgconfig:$PKG_CONFIG_PATH" >> $GITHUB_ENV
echo "DYLD_LIBRARY_PATH=/opt/homebrew/lib:$DYLD_LIBRARY_PATH" >> $GITHUB_ENV
- name: Install Windows dependencies
if: matrix.os == 'windows-latest'
run: |
choco install msys2 --yes
C:\tools\msys64\usr\bin\pacman -S --noconfirm mingw-w64-x86_64-cairo mingw-w64-x86_64-pkg-config
echo "C:\tools\msys64\mingw64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Install poetry
run: pipx install poetry
- name: Setup Python ${{ matrix.python-version }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
__pycache__/
.idea
data-tests/
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ Command line tool for converting to/from remarkable `.rm` version 6 (software ve

## Installation

If you want to render your documents as PDF or SVG, you will need to install cairo.

- On Windows, you need to install cairo using [msys2](https://packages.msys2.org/packages/mingw-w64-x86_64-gtk3)
- On MacOS, install cairo using homebrew: `brew install cairo libxml2 libffi`
- On Linux, make sure `libcairo2` is installed. Refer to [this thread](https://github.com/Kozea/CairoSVG/issues/371) for full context on packages if you run into any issues

To install in your current Python environment:

pip install rmc
Expand Down
131 changes: 130 additions & 1 deletion flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 26 additions & 10 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,43 @@
inputs = {
nixpkgs.url = "nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
poetry2nix = { url = "github:nix-community/poetry2nix"; };
};

outputs = { self, nixpkgs, flake-utils }:
outputs = { self, nixpkgs, flake-utils, poetry2nix }:
flake-utils.lib.eachDefaultSystem (system:
let
pythonEnv = pkgs.python312.withPackages (ps: []);
pkgs = import nixpkgs {
inherit system;
};
inherit (poetry2nix.lib.mkPoetry2Nix { inherit pkgs; })
mkPoetryEnv mkPoetryApplication defaultPoetryOverrides;
poetryArgs = {
python = pkgs.python312;
projectDir = ./.;
preferWheels = true;
overrides = defaultPoetryOverrides.extend (final: prev: {
click = prev.click.overridePythonAttrs (old: {
buildInputs = (old.buildInputs or [ ]) ++ [ prev.flit-scm ];
});
rmc = prev.rmc.overridePythonAttrs (old: {
buildInputs = (old.buildInputs or [ ]) ++ [ prev.poetry-core ];
});
});
};
pythonEnv = mkPoetryEnv (poetryArgs);
rmcBin = mkPoetryApplication (poetryArgs);
in
{
packages = {
default = rmcBin;
};
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
sqlite.dev
poetry
inkscape
buildInputs = [
pkgs.poetry
rmcBin
pythonEnv
];

LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [
pkgs.sqlite.out
];
};
});
}
Loading
Loading