diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..53d82bf --- /dev/null +++ b/default.nix @@ -0,0 +1,50 @@ +{ lib +, stdenvNoCC +, fetchzip +, buildFHSEnv +}: + +let + package = stdenvNoCC.mkDerivation rec { + pname = "CoolTerm"; + version = "2.1.1"; + + src = fetchzip { + url = "https://freeware.the-meiers.org/previous/CoolTermLinux64Bit${builtins.replaceStrings ["."] [""] version}.zip"; + sha256 = "sha256-ly01SivP0gghEfNT1SvexOB5Zumo/cwiNtkirkG+ncU="; + }; + + buildCommand = '' + mkdir -p $out/opt/ + cp -r $src $out/opt/CoolTerm + ''; + + meta = with lib; { + description = ""; + longDescription = '' + ''; + homepage = "https://freeware.the-meiers.org/"; + sourceProvenance = with sourceTypes; [ binaryNativeCode ]; + license = licenses.unfree; + maintainers = with maintainers; [ mlaga97 ]; + platforms = [ "x86_64-linux" ]; + }; + }; +in + +buildFHSEnv { + inherit (package) pname meta; + runScript = "${package.outPath}/opt/CoolTerm/CoolTerm"; + targetPkgs = pkgs: (with pkgs; [ + libgcc + cairo + gtk3 + libunwind + pango + atk + gtkd + glib + gdk-pixbuf + xorg.libX11 + ]); +} diff --git a/flake.nix b/flake.nix deleted file mode 100644 index 1472bbd..0000000 --- a/flake.nix +++ /dev/null @@ -1,54 +0,0 @@ -{ - description = "Test"; - - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs"; - }; - - outputs = { self, nixpkgs }: { - defaultPackage.x86_64-linux = with import nixpkgs { - system = "x86_64-linux"; - }; stdenv.mkDerivation rec { - name = "coolterm"; - version = "2.1.1"; - - src = pkgs.fetchzip { - url = "https://freeware.the-meiers.org/previous/CoolTermLinux64Bit211.zip"; - sha256 = "sha256-ly01SivP0gghEfNT1SvexOB5Zumo/cwiNtkirkG+ncU="; - }; - - nativeBuildInputs = [ - autoPatchelfHook - ]; - - buildInputs = [ - libgcc - cairo - gtk3 - libunwind - ]; - - sourceRoot = "."; - - installPhase = '' - runHook preInstall - - mkdir -p $out/opt/ - cp -r ./source/* $out/opt/ - - for i in `ls -1 "./source/CoolTerm Libs/"`; do - install -m755 -D "./source/CoolTerm Libs/$i" $out/lib/$i - done - install -m755 -D "./source/CoolTerm" $out/bin/CoolTerm - - runHook postInstall - ''; - - meta = with lib; { - homepage = "https://freeware.the-meiers.org/"; - description = "CoolTerm"; - platforms = platforms.linux; - }; - }; - }; -}