Skip to content

Commit 798535e

Browse files
authored
wml: 2.0.11 -> 2.32.0, adopt (NixOS#460274)
2 parents e1a9a0d + 611c679 commit 798535e

File tree

4 files changed

+63
-109
lines changed

4 files changed

+63
-109
lines changed

pkgs/by-name/wm/wml/dynaloader.patch

Lines changed: 0 additions & 11 deletions
This file was deleted.

pkgs/by-name/wm/wml/no_bitvector.patch

Lines changed: 0 additions & 10 deletions
This file was deleted.

pkgs/by-name/wm/wml/package.nix

Lines changed: 63 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,92 +1,86 @@
11
{
2+
cmake,
3+
fetchFromGitHub,
24
lib,
3-
fetchurl,
4-
perlPackages,
5-
ncurses,
65
lynx,
7-
makeWrapper,
6+
makeBinaryWrapper,
7+
ncurses,
8+
pcre,
9+
perl,
10+
perlPackages,
11+
stdenv,
812
}:
9-
10-
perlPackages.buildPerlPackage {
13+
let
14+
shlomif-cmake-modules = fetchFromGitHub {
15+
owner = "shlomif";
16+
repo = "shlomif-cmake-modules";
17+
rev = "2fa3e9be1a1df74ad0e10f0264bfa60e1e3a755c";
18+
hash = "sha256-MNGpegbZRwfD8A3VHVNYrDULauLST3Nt18/3Ht6mpZw=";
19+
};
20+
perlDeps = with perlPackages; [
21+
BitVector
22+
CarpAlways
23+
ClassXSAccessor
24+
FileWhich
25+
GD
26+
ImageSize
27+
ListMoreUtils
28+
PathTiny
29+
TermReadKey
30+
];
31+
in
32+
stdenv.mkDerivation (finalAttrs: {
1133
pname = "wml";
12-
version = "2.0.11";
34+
version = "2.32.0";
1335

14-
src = fetchurl {
15-
url = "http://thewml.org/distrib/wml-2.0.11.tar.gz";
16-
sha256 = "0jjxpq91x7y2mgixz7ghqp01m24qa37wl3zz515rrzv7x8cyy4cf";
36+
src = fetchFromGitHub {
37+
owner = "thewml";
38+
repo = "website-meta-language";
39+
tag = "releases/wml-${finalAttrs.version}";
40+
hash = "sha256-9ZiMGm0W2qS/7nL8NsmGBsuB5sNJvWuJaxE7CTdWo6s=";
1741
};
1842

19-
setOutputFlags = false;
43+
sourceRoot = "${finalAttrs.src.name}/src";
2044

21-
# Getting lots of Non-ASCII character errors from pod2man.
22-
# Inserting =encoding utf8 before the first =head occurrence.
23-
# Wasn't able to fix mp4h.
24-
preConfigure = ''
25-
touch Makefile.PL
26-
for i in wml_backend/p6_asubst/asubst.src wml_aux/freetable/freetable.src wml_docs/*.pod wml_include/des/*.src wml_include/fmt/*.src; do
27-
sed -i '0,/^=head/{s/^=head/=encoding utf8\n=head/}' $i
28-
done
29-
sed -i 's/ doc / /g' wml_backend/p2_mp4h/Makefile.in
30-
sed -i '/p2_mp4h\/doc/d' Makefile.in
45+
# https://github.com/thewml/website-meta-language/commit/727806494dcb9d334ffb324aedbf6076e4796299
46+
postPatch = ''
47+
substituteInPlace CMakeLists.txt \
48+
--replace-fail 'CMAKE_MINIMUM_REQUIRED(VERSION 3.0)' 'CMAKE_MINIMUM_REQUIRED(VERSION 3.15)'
3149
'';
3250

33-
nativeBuildInputs = [ makeWrapper ];
34-
buildInputs = with perlPackages; [
35-
perl
36-
TermReadKey
37-
GD
38-
BitVector
39-
ncurses
51+
nativeBuildInputs = [
52+
cmake
4053
lynx
41-
ImageSize
54+
makeBinaryWrapper
4255
];
4356

44-
patches = [
45-
./redhat-with-thr.patch
46-
./dynaloader.patch
47-
./no_bitvector.patch
57+
buildInputs = perlDeps ++ [
58+
ncurses
59+
pcre
60+
perl
4861
];
4962

50-
# Workaround build failure on -fno-common toolchains:
51-
# ld: iselect_browse.o:(.bss+0x2020): multiple definition of `Line'; iselect_main.o:(.bss+0x100000): first defined here
52-
env.NIX_CFLAGS_COMPILE = "-fcommon";
53-
54-
hardeningDisable = [ "format" ];
55-
56-
postPatch = ''
57-
substituteInPlace wml_frontend/wml.src \
58-
--replace "File::PathConvert::realpath" "Cwd::realpath" \
59-
--replace "File::PathConvert::abs2rel" "File::Spec->abs2rel" \
60-
--replace "File::PathConvert" "File::Spec"
61-
62-
for i in wml_include/des/imgbg.src wml_include/des/imgdot.src; do
63-
substituteInPlace $i \
64-
--replace "WML::GD" "GD"
65-
done
66-
67-
rm wml_test/t/11-wmk.t
63+
preConfigure = ''
64+
ln -s ${shlomif-cmake-modules}/shlomif-cmake-modules/Shlomif_Common.cmake cmake/
6865
'';
6966

7067
preFixup = ''
71-
wrapProgram $out/bin/wml \
72-
--set PERL5LIB ${
73-
with perlPackages;
74-
makePerlPath [
75-
BitVector
76-
TermReadKey
77-
ImageSize
78-
]
79-
}
80-
'';
81-
82-
enableParallelBuilding = false;
68+
rm $out/bin/wmu
8369
84-
installTargets = [ "install" ];
70+
for f in $(find $out/bin/ -type f -executable); do
71+
wrapProgram "$f" \
72+
--set PERL5LIB ${perlPackages.makePerlPath perlDeps}
73+
done
74+
'';
8575

86-
meta = with lib; {
76+
meta = {
77+
description = "Offline HTML preprocessor";
8778
homepage = "https://www.shlomifish.org/open-source/projects/website-meta-language/";
88-
description = "Off-line HTML generation toolkit for Unix";
89-
license = licenses.gpl2;
90-
platforms = platforms.linux;
79+
downloadPage = "https://github.com/thewml/website-meta-language/releases";
80+
changelog = "https://github.com/thewml/website-meta-language/blob/${finalAttrs.src.tag}/src/ChangeLog";
81+
license = lib.licenses.gpl2;
82+
maintainers = with lib.maintainers; [ prince213 ];
83+
mainProgram = "wml";
84+
platforms = lib.platforms.linux;
9185
};
92-
}
86+
})

pkgs/by-name/wm/wml/redhat-with-thr.patch

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)