Skip to content

Commit

Permalink
icmake: refactor
Browse files Browse the repository at this point in the history
- nixfmt-rfc-style
- finalAttrs
- strictDeps
- hammer
- no nested with
- more meta attrs

icmake
  • Loading branch information
AndersonTorres committed Oct 9, 2024
1 parent 01cf983 commit 84ff4c9
Showing 1 changed file with 55 additions and 19 deletions.
74 changes: 55 additions & 19 deletions pkgs/by-name/ic/icmake/package.nix
Original file line number Diff line number Diff line change
@@ -1,46 +1,82 @@
{ lib, stdenv, fetchFromGitLab, makeWrapper, gcc, ncurses }:
{
lib,
fetchFromGitLab,
gcc,
makeWrapper,
ncurses,
stdenv,
}:

stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "icmake";
version = "9.03.01";

src = fetchFromGitLab {
sha256 = "05r0a69w0hv2qhjpb2bxd0lmp2vv5r2d4iggg6ly4miam0i318jy";
rev = version;
repo = "icmake";
owner = "fbb-git";
repo = "icmake";
rev = finalAttrs.version;
hash = "sha256-XqIwIqgqVuKpee9F0kQue4tbKWh9iXUlxGJDwJNRIBc=";
};


setSourceRoot = ''
sourceRoot=$(echo */icmake)
'';

nativeBuildInputs = [ makeWrapper ];

buildInputs = [ gcc ];

preConfigure = ''
sourceRoot = "${finalAttrs.src.name}/icmake";

strictDeps = true;

postPatch = ''
patchShebangs ./
substituteInPlace INSTALL.im --replace "usr/" ""
substituteInPlace INSTALL.im \
--replace "usr/" ""
'';

buildPhase = ''
runHook preBuild
./icm_prepare $out
./icm_bootstrap x
runHook postBuild
'';

installPhase = ''
runHook preInstall
./icm_install all /
wrapProgram $out/bin/icmbuild \
--prefix PATH : ${ncurses}/bin
--prefix PATH : ${ncurses}/bin
runHook postInstall
'';

meta = with lib; {
description = "Program maintenance (make) utility using a C-like grammar";
meta = {
homepage = "https://fbb-git.gitlab.io/icmake/";
license = licenses.gpl3;
maintainers = with maintainers; [ pSub ];
platforms = platforms.linux;
description = "Program maintenance utility using a C-like grammar";
longDescription = ''
Icmake can be used as an alternative to make(1).
Icmake allows the programmer to use a program language (closely resembling
the well-known C-programming language) to define the actions involved in
(complex) program maintenance. For this, icmake offers various special
operators as well as a set of support functions that have proven to be
useful in program maintenance.
Traditional make-utilities recompile sources once header files are
modified. In the context of C++ program development this is often a bad
idea, as adding a new member to a class does not normally require you to
recompile the class's sources. To handle class dependencies in a more
sensible way, icmake's CLASSES file may define dependencies among
classes. By default, class-dependencies are not interpreted.
'';
license = lib.licenses.gpl3;
mainProgram = "icmake";
maintainers = with lib.maintainers; [
pSub
AndersonTorres
];
platforms = lib.platforms.all;
};
}
})

0 comments on commit 84ff4c9

Please sign in to comment.