Skip to content

Commit

Permalink
ref: change the way tl libs are bundled
Browse files Browse the repository at this point in the history
  • Loading branch information
Dich0tomy committed May 23, 2024
1 parent 89ab28c commit 9673ce0
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 23 deletions.
4 changes: 2 additions & 2 deletions nix/dependencies/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{pkgs}: {
tl-optional = pkgs.callPackage ./tl-optional {version = "1.1.0";};
tl-expected = pkgs.callPackage ./tl-expected {version = "1.1.0";};
tl-optional = pkgs.callPackage ./tl-optional {};
tl-expected = pkgs.callPackage ./tl-expected {};
}
27 changes: 17 additions & 10 deletions nix/dependencies/tl-expected/default.nix
Original file line number Diff line number Diff line change
@@ -1,23 +1,30 @@
{
pkgs,
version,
stdenv,
cmake,
fetchFromGitHub
}:
pkgs.stdenv.mkDerivation {
stdenv.mkDerivation (self: {
pname = "expected";
inherit version;
version = "1.1.0";

src = pkgs.fetchFromGitHub {
src = fetchFromGitHub {
owner = "TartanLlama";
repo = "expected";
rev = "v${version}";
rev = "v${self.version}";
sha256 = "sha256-AuRU8VI5l7Th9fJ5jIc/6mPm0Vqbbt6rY8QCCNDOU50=";
};

nativeBuildInputs = [pkgs.cmake];
strictDeps = true;

strictDeps = true;
nativeBuildInputs = [cmake];

postInstall = ''
install -Dm644 ${./expected.pc} $out/lib/pkgconfig/expected.pc
mkdir -p $out/lib/pkgconfig
substitute \
${./expected.pc} \
$out/lib/pkgconfig/expected.pc \
--subst-var out \
--subst-var version
'';
}
})
2 changes: 1 addition & 1 deletion nix/dependencies/tl-expected/expected.pc
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ includedir=${prefix}/include

Name: expected
Description: TartanLlama's expected
Version: 1.1.0
Version: @version@
Cflags: -I${includedir}/
25 changes: 16 additions & 9 deletions nix/dependencies/tl-optional/default.nix
Original file line number Diff line number Diff line change
@@ -1,23 +1,30 @@
{
pkgs,
version,
stdenv,
cmake,
fetchFromGitHub
}:
pkgs.stdenv.mkDerivation {
stdenv.mkDerivation (self: {
pname = "optional";
inherit version;
version = "1.1.0";

src = pkgs.fetchFromGitHub {
src = fetchFromGitHub {
owner = "TartanLlama";
repo = "optional";
rev = "v${version}";
rev = "v${self.version}";
sha256 = "sha256-WPTXTQmzJjAIJI1zM6svZZTO8gP/jt5xDHHRCCu9cmI=";
};

strictDeps = true;

nativeBuildInputs = [pkgs.cmake];
nativeBuildInputs = [cmake];

postInstall = ''
install -Dm644 ${./optional.pc} $out/lib/pkgconfig/optional.pc
mkdir -p $out/lib/pkgconfig
substitute \
${./optional.pc} \
$out/lib/pkgconfig/optional.pc \
--subst-var out \
--subst-var version
'';
}
})
2 changes: 1 addition & 1 deletion nix/dependencies/tl-optional/optional.pc
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ includedir=${prefix}/include

Name: optional
Description: TartanLlama's optional
Version: 1.1.0
Version: @version@
Cflags: -I${includedir}/

0 comments on commit 9673ce0

Please sign in to comment.