Skip to content

Commit

Permalink
build(darwin): fix nix build
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcjkb committed Aug 11, 2024
1 parent e242eaf commit 46a1bf1
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 57 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
with:
ref: ${{ github.ref }}

# - name: Install C/C++ Compiler
# uses: rlalik/setup-cpp-compiler@master
# with:
# compiler: clang-latest
- name: Install C/C++ Compiler
uses: rlalik/setup-cpp-compiler@master
with:
compiler: clang-latest

- name: Install MSVC Compiler Toolchain
uses: ilammy/msvc-dev-cmd@v1
Expand All @@ -39,15 +39,15 @@ jobs:

- name: Install build dependencies
run: |
luarocks --local --lua-version=5.1 make ./luarocks-build-treesitter-parser-scm-1.rockspec
luarocks --local --lua-version=5.1 make ./luarocks-build-treesitter-parser-cpp-scm-1.rockspec
- name: Install tree-sitter parser
run: |
luarocks --local --lua-version=5.1 install tree-sitter-haskell --dev
- name: Pack and create manifest
run: |
luarocks pack tree-sitter-haskell
luarocks pack tree-sitter-norg
luarocks-admin make-manifest --lua-version=5.1 .
dir
type manifest-5.1
79 changes: 28 additions & 51 deletions nix/overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,63 +16,40 @@
];
}) {};

tree-sitter-norg =
(luaself.callPackage ({
buildLuarocksPackage,
fetchFromGitHub,
luaOlder,
luarocks-build-treesitter-parser-cpp,
}:
buildLuarocksPackage {
pname = "tree-sitter-norg";
version = "scm-1";
knownRockspec = "${self}/fixtures/tree-sitter-norg-scm-1.rockspec";
src = fetchFromGitHub {
owner = "nvim-neorg";
repo = "tree-sitter-norg";
rev = "014073fe8016d1ac440c51d22c77e3765d8f6855";
hash = "sha256-0wL3Pby7e4nbeVHCRfWwxZfEcAF9/s8e6Njva+lj+Rc=";
};
propagatedBuildInputs = [
luarocks-build-treesitter-parser-cpp
];
disabled = luaOlder "5.1";
fixupPhase = ''
if [ ! -f $out/lib/lua/5.1/parser/norg.so ]; then
echo "Build did not create parser/norg.so in the expected location"
exit 1
fi
if [ -f $out/lib/lua/5.1/parser/norg.so.dSYM ]; then
echo "Unwanted darwin debug symbols!"
exit 1
fi
'';
}) {})
.overrideAttrs (oa: {
nativeBuildInputs =
oa.nativeBuildInputs
++ (with final;
lib.optionals stdenv.isDarwin [
clang
]);
tree-sitter-norg = luaself.callPackage ({
buildLuarocksPackage,
fetchFromGitHub,
luaOlder,
luarocks-build-treesitter-parser-cpp,
}:
buildLuarocksPackage {
pname = "tree-sitter-norg";
version = "scm-1";
knownRockspec = "${self}/fixtures/tree-sitter-norg-scm-1.rockspec";
src = fetchFromGitHub {
owner = "nvim-neorg";
repo = "tree-sitter-norg";
rev = "014073fe8016d1ac440c51d22c77e3765d8f6855";
hash = "sha256-0wL3Pby7e4nbeVHCRfWwxZfEcAF9/s8e6Njva+lj+Rc=";
};
propagatedBuildInputs = [
luarocks-build-treesitter-parser-cpp
];
disabled = luaOlder "5.1";
fixupPhase = ''
if [ ! -f $out/lib/lua/5.1/parser/norg.so ]; then
echo "Build did not create parser/norg.so in the expected location"
exit 1
echo "Build did not create parser/norg.so in the expected location"
exit 1
fi
if [ -f $out/lib/lua/5.1/parser/norg.so.dSYM ]; then
echo "Unwanted darwin debug symbols!"
exit 1
fi
'';
});

}) {};
};
lua5_1_base =
if prev.stdenv.isDarwin
then
prev.lua5_1.override {
stdenv = final.clangStdenv;
}
else prev.lua5_1;
in {
lua5_1 = lua5_1_base.override {
lua5_1 = prev.lua5_1.override {
packageOverrides = luaPackage-override;
};
lua51Packages = final.lua5_1.pkgs;
Expand Down

0 comments on commit 46a1bf1

Please sign in to comment.