Compare commits

...

2 Commits

Author SHA1 Message Date
Přemysl Eric Janouch 8e0826b8b3
Update xK 2023-07-04 23:23:45 +02:00
Přemysl Eric Janouch 8a97713fa1
Avoid uppercase letters in derivation names 2023-07-04 22:33:23 +02:00
1 changed files with 20 additions and 9 deletions

View File

@ -3,7 +3,9 @@
, full ? true
}:
pkgs.stdenv.mkDerivation rec {
pname = "xK";
_pname = "xK";
pname = pkgs.lib.strings.toLower _pname;
_version = pkgs.lib.strings.fileContents (src + "/xK-version");
version = "master";
nativeBuildInputs = with pkgs; [
@ -37,12 +39,12 @@ pkgs.stdenv.mkDerivation rec {
src = if local then
builtins.path {
path = ../${pname}/git;
name = "${pname}";
path = ../${_pname}/git;
name = "${_pname}";
}
else
fetchGit {
url = "https://git.janouch.name/p/${pname}.git";
url = "https://git.janouch.name/p/${_pname}.git";
submodules = true;
ref = "master";
};
@ -55,10 +57,11 @@ pkgs.stdenv.mkDerivation rec {
];
xP = pkgs.buildGoModule rec {
pname = "xP";
_pname = "xP";
pname = pkgs.lib.strings.toLower _pname;
inherit version src doCheck meta;
modRoot = "./${pname}/";
modRoot = "./${_pname}/";
# vendorHash = pkgs.lib.fakeHash;
vendorHash = "sha256-TK3rivjzYZwG8bfia22iQO5ZKnBzeIidsHNl6jnQUio=";
@ -85,16 +88,24 @@ pkgs.stdenv.mkDerivation rec {
};
xS = pkgs.buildGoModule rec {
pname = "xS";
_pname = "xS";
pname = pkgs.lib.strings.toLower _pname;
inherit version src doCheck meta;
modRoot = "./${pname}/";
modRoot = "./${_pname}/";
vendorHash = null;
# This invokes a premature build that may miss compiler flags.
preBuild = ''
make
'';
ldflags = [ "-X 'main.projectVersion=${_version}'" ];
postInstall = ''
mkdir -p $out/share/man/man1
mv xS.1 $out/share/man/man1
'';
};
# While we can't include them in this derivation, we can link to them.
@ -108,7 +119,7 @@ pkgs.stdenv.mkDerivation rec {
meta = with pkgs.lib; {
description = "IRC daemon, bot, TUI client"
+ optionals full " and its web frontend";
homepage = "https://git.janouch.name/p/${pname}";
homepage = "https://git.janouch.name/p/${_pname}";
platforms = platforms.all;
license = licenses.bsd0;
};