zaphyra's git: tgcNUR

fork of https://git.transgirl.cafe/zaphoid/tgc-nix-user-repository

1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
13 
14 
15 
16 
17 
18 
19 
20 
21 
22 
23 
24 
25 
26 
27 
28 
29 
30 
31 
32 
33 
34 
35 
36 
37 
38 
39 
40 
41 
42 
43 
44 
45 
46 
47 
48 
49 
50 
51 
52 
53 
{
  tgcMaintainers,
  lib,
  fetchFromGitHub,
  clangStdenv,
  swift-corelibs-libdispatch,
  python3,
  ...
}:

clangStdenv.mkDerivation (finalAttrs: {
  pname = "oneKpaq";
  version = "unstable-2022-04-04";
  rev = "557e99036f488414a9d6a94656cb3f03da22f8a0";
  srcHash = "sha256-zvLy7GfpaTOnJOC/ca/vgw3gTiGmrgGiY9sCY/g7UFQ=";

  src = fetchFromGitHub {
    owner = "temisu";
    repo = finalAttrs.pname;
    rev = finalAttrs.rev;
    hash = finalAttrs.srcHash;
  };

  postPatch = ''
    echo "HAS_LIBDISPATCH=1" > ./config.mk
    echo "LIBDISPATCH_INC_DIR=${swift-corelibs-libdispatch.dev}/include" >> ./config.mk
    echo "LIBDISPATCH_LIB_DIR=${swift-corelibs-libdispatch}/lib" >> ./config.mk
  '';

  buildInputs = [
    python3
  ];

  installPhase = ''
    runHook preInstall

    mkdir -p $out/bin
    cp ./onekpaq $out/bin
    cp ./onekpaq.py $out/bin/onekpaq.py
    ln -s $out/bin/onekpaq $out/bin/onekpaq_encode

    runHook postInstall
  '';

  meta = {
    mainProgram = "onekpaq.py";
    description = "PPM compressor with a 128 bytes short decompressor";
    homepage = "https://github.com/temisu/oneKpaq";
    license = lib.licenses.bsd2;
    maintainers = [ tgcMaintainers.zaphyra ];
    platforms = lib.platforms.unix;
  };
})