summaryrefslogtreecommitdiffhomepage
path: root/derivation.nix
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2026-04-10 21:30:13 -0400
committerRalph Amissah <ralph.amissah@gmail.com>2026-04-10 21:30:13 -0400
commit9dd16085ce740af9244e00839da364ecd4f722b8 (patch)
treec1dcbdcccdb93f74a8d74a30d2749f82c6db41f5 /derivation.nix
parentflake.nix dmd build fix overlay: revert to GCC14 (diff)
nix keeping: nix-shell, nix-build derivation.nix
Diffstat (limited to 'derivation.nix')
-rwxr-xr-x[-rw-r--r--]derivation.nix30
1 files changed, 14 insertions, 16 deletions
diff --git a/derivation.nix b/derivation.nix
index a27956f..95797b4 100644..100755
--- a/derivation.nix
+++ b/derivation.nix
@@ -1,3 +1,4 @@
+#!/usr/bin/env -S nix-build derivation.nix
{
pkgs ? import <nixpkgs> {},
stdenv ? pkgs.stdenv,
@@ -17,7 +18,7 @@ with (
);
targetOf = package: "${package.targetPath or "."}/${package.targetName or package.name}";
# remove reference to build tools and library sources
- disallowedReferences = deps: [dcompiler dub];
+ disallowedRefs = [dcompiler dub];
removeExpr = refs: ''remove-references-to ${lib.concatMapStrings (ref: " -t ${ref}") refs}'';
in {
mkDubDerivation = lib.makeOverridable ({
@@ -30,9 +31,9 @@ with (
} @ attrs:
stdenv.mkDerivation (attrs
// {
- pname = package.name;
+ pname = attrs.pname or package.name;
nativeBuildInputs = [dcompiler dub pkgs.removeReferencesTo] ++ nativeBuildInputs;
- disallowedReferences = disallowedReferences deps;
+ disallowedReferences = disallowedRefs;
passthru =
passthru
// {
@@ -43,7 +44,7 @@ with (
src = lib.cleanSource src;
};
preFixup = ''
- find $out/cgi-bin -type f -exec ${removeExpr (disallowedReferences deps)} '{}' + || true
+ find $out/cgi-bin -type f -exec ${removeExpr disallowedRefs} '{}' + || true
'';
buildPhase = ''
runHook preBuild
@@ -57,7 +58,8 @@ with (
fi
done
if [ "$DC" == "" ]; then
- exit "Error: could not find D compiler"
+ echo "Error: could not find D compiler" >&2
+ exit 1
fi
echo "$DC_ used as D compiler to build $pname"
dub run --compiler=$DC --build=release --combined --skip-registry=all
@@ -72,12 +74,10 @@ with (
installPhase = ''
runHook preInstall
mkdir -p $out/cgi-bin
- cp -r "${targetOf package}" $out/cgi-bin
- install -m755 -D $out/cgi-bin/spine_search spine_search
+ install -m755 -D "${targetOf package}" "$out/cgi-bin/spine_search"
runHook postInstall
'';
postInstall = ''
- echo "HERE ${targetOf package} $out/cgi-bin"
echo `ls -la $out/cgi-bin/spine_search`
'';
meta =
@@ -92,34 +92,32 @@ with (
}
);
mkDubDerivation rec {
- name = "spine-search-0.18.0";
- #name = "spine-search-${version}";
+ pname = "spine-search";
+ version = "0.18.0";
src = ./.;
buildInputs = [
pkgs.sqlite
(
- with pkgs-nix; [
+ with pkgs; [
nixVersions.latest #nixVersions.latest #nixVersions.git
## package manager
dub
## compiler
ldc
- rund
+ #rund
sqlite
]
)
];
- meta = with pkgs-nix.lib; {
- pname = "spine-search";
- version = "0.18.0";
+ meta = with pkgs.lib; {
homepage = "https://sisudoc.org";
description = "cgi sqlite search form for document object search";
longDescription = ''
a sisu like parser & document generator
'';
- homepage = "https://sisudoc.org";
license = licenses.agpl3Plus;
platforms = platforms.linux;
maintainers = ["RalphAmissah"];
+ mainProgram = "spine_search";
};
}