nur-packages

My NUR packages
git clone git://git.sikmir.ru/nur-packages
Log | Files | Refs | README | LICENSE

default.nix (1516B)


      1 { lib, stdenv, fetchzip, gcc-arm-embedded, zip
      2 , platform ? null, platformsub ? null
      3 , fi2key ? null, fi2iv ? null
      4 }:
      5 
      6 let
      7   version = "1.6.1";
      8   revision = "6239"; # check on http://mighty-hoernsche.de/
      9   branch = "release-${lib.replaceStrings [ "." ] [ "_" ] (lib.versions.majorMinor version)}";
     10   optFI2 = fi2key != null && fi2iv != null;
     11   batchBuild = platform == null || platformsub == null;
     12 in
     13 stdenv.mkDerivation {
     14   pname = "chdk";
     15   inherit version;
     16 
     17   src = fetchzip {
     18     url = "https://app.assembla.com/spaces/chdk/subversion/source/${revision}/branches/${branch}?_format=zip";
     19     extension = "zip";
     20     stripRoot = false;
     21     hash = "sha256-gqb9JvPyzW77wlpZJqg3IYaGafQIzFopzGy9MZbr8Zs=";
     22   };
     23 
     24   nativeBuildInputs = [ gcc-arm-embedded zip ];
     25 
     26   buildFlags = [ "DEF_SVN_REF=${revision}" "HOSTCC=${stdenv.cc.targetPrefix}cc" ]
     27     ++ lib.optionals (optFI2 && !batchBuild) [ "OPT_FI2=1" "FI2KEY=${fi2key}" "FI2IV=${fi2iv}" ]
     28     ++ lib.optionals (!batchBuild) [ "PLATFORM=${platform}" "PLATFORMSUB=${platformsub}" "firzipsubcomplete" ]
     29     ++ lib.optional batchBuild "batch-zip-complete";
     30 
     31   env.NIX_CFLAGS_COMPILE = "-Wno-format-security";
     32 
     33   installPhase = ''
     34     runHook preInstall
     35     install -Dm644 bin/*.zip -t $out
     36     runHook postInstall
     37   '';
     38 
     39   meta = with lib; {
     40     description = "Canon Hack Development Kit";
     41     homepage = "https://chdk.fandom.com/wiki/CHDK";
     42     license = licenses.gpl2;
     43     platforms = platforms.unix;
     44     maintainers = [ maintainers.sikmir ];
     45     skip.ci = true;
     46   };
     47 }