-
-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #189045 from leungbk/edea2
ocamlPackages.plotkicadsch: init at 0.9
- Loading branch information
Showing
5 changed files
with
106 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ lib | ||
, buildDunePackage | ||
, fetchurl | ||
}: | ||
|
||
buildDunePackage rec { | ||
pname = "kicadsch"; | ||
version = "0.9.0"; | ||
|
||
minimalOCamlVersion = "4.07"; | ||
|
||
src = fetchurl { | ||
url = "https://github.com/jnavila/plotkicadsch/releases/download/v${version}/plotkicadsch-${version}.tbz"; | ||
sha256 = "sha256-B+vnEPyd3SUzviTdNoyvYk0p7Hrg/XTJm8KxsY8A4jQ="; | ||
}; | ||
|
||
meta = with lib; { | ||
description = "OCaml library for exporting Kicad Sch files to SVG pictures"; | ||
homepage = "https://github.com/jnavila/plotkicadsch"; | ||
license = licenses.isc; | ||
maintainers = with maintainers; [ leungbk ]; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ lib | ||
, buildDunePackage | ||
, fetchFromGitHub | ||
, substituteAll | ||
, base64 | ||
, cmdliner | ||
, digestif | ||
, git-unix | ||
, kicadsch | ||
, lwt | ||
, lwt_ppx | ||
, sha | ||
, tyxml | ||
, coreutils | ||
, imagemagick | ||
}: | ||
|
||
buildDunePackage rec { | ||
pname = "plotkicadsch"; | ||
|
||
inherit (kicadsch) src version; | ||
|
||
minimalOCamlVersion = "4.09"; | ||
|
||
patches = [ | ||
(substituteAll { | ||
src = ./fix-paths.patch; | ||
inherit coreutils imagemagick; | ||
}) | ||
]; | ||
|
||
buildInputs = [ | ||
base64 | ||
cmdliner | ||
digestif | ||
git-unix | ||
kicadsch | ||
lwt | ||
lwt_ppx | ||
sha | ||
tyxml | ||
]; | ||
|
||
meta = with lib; { | ||
description = "A tool to export Kicad Sch files to SVG pictures"; | ||
homepage = "https://github.com/jnavila/plotkicadsch"; | ||
license = licenses.isc; | ||
maintainers = with maintainers; [ leungbk ]; | ||
}; | ||
} |
26 changes: 26 additions & 0 deletions
26
pkgs/development/ocaml-modules/plotkicadsch/fix-paths.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
diff --git a/plotkicadsch/src/git-imgdiff b/plotkicadsch/src/git-imgdiff | ||
index cbddecb..8d21a8a 100755 | ||
--- a/plotkicadsch/src/git-imgdiff | ||
+++ b/plotkicadsch/src/git-imgdiff | ||
@@ -1,4 +1,4 @@ | ||
#!/bin/bash | ||
PIPE=$(mktemp -u) | ||
-(! compare -metric RMSE $2 $1 png:${PIPE} 2> /dev/null) && (montage -geometry +4+4 $2 $PIPE $1 png:- | display -title "$1" -) | ||
+(! @imagemagick@/bin/compare -metric RMSE $2 $1 png:${PIPE} 2> /dev/null) && (@imagemagick@/bin/montage -geometry +4+4 $2 $PIPE $1 png:- | @imagemagick@/bin/display -title "$1" -) | ||
rm $PIPE | ||
diff --git a/plotkicadsch/src/sysAbst.ml b/plotkicadsch/src/sysAbst.ml | ||
index c3c7b52..15db6d4 100644 | ||
--- a/plotkicadsch/src/sysAbst.ml | ||
+++ b/plotkicadsch/src/sysAbst.ml | ||
@@ -30,7 +30,7 @@ let detect_os () : os = | ||
if Sys.win32 then Windows | ||
else if Sys.cygwin then Cygwin | ||
else | ||
- let ((in_ch, _, _) as uname) = UnixLabels.open_process_full "uname" ~env:[| |] in | ||
+ let ((in_ch, _, _) as uname) = UnixLabels.open_process_full "@coreutils@/bin/uname" ~env:[| |] in | ||
let os = input_line in_ch in | ||
ignore (UnixLabels.close_process_full uname) ; | ||
match os with | ||
-- | ||
2.37.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters