eukleides: unbreak, switch to mirror

This commit is contained in:
Petr Zahradnik 2025-06-08 14:36:32 +02:00
parent dbe4980a89
commit 055b892a4f
2 changed files with 47 additions and 10 deletions

View file

@ -1,23 +1,28 @@
{ {
lib, lib,
stdenv, stdenv,
fetchurl, fetchFromGitLab,
bison, bison,
flex, flex,
makeWrapper, makeWrapper,
texinfo4,
getopt, getopt,
readline, readline,
texinfo,
texlive, texlive,
versionCheckHook,
}: }:
stdenv.mkDerivation (finalAttrs: { stdenv.mkDerivation (finalAttrs: {
pname = "eukleides"; pname = "eukleides";
version = "1.5.4"; version = "1.5.4";
src = fetchurl { src = fetchFromGitLab {
url = "http://www.eukleides.org/files/eukleides-${finalAttrs.version}.tar.bz2"; # official upstream www.eukleides.org is down
sha256 = "0s8cyh75hdj89v6kpm3z24i48yzpkr8qf0cwxbs9ijxj1i38ki0q"; domain = "salsa.debian.org";
owner = "georgesk";
repo = "eukleides";
rev = "upstream/${finalAttrs.version}";
hash = "sha256-keX7k14X/97zHh87A/7vUsfGc/S6fByd+rewW+LkJeM=";
}; };
patches = [ patches = [
@ -25,12 +30,14 @@ stdenv.mkDerivation (finalAttrs: {
./use-CC.patch ./use-CC.patch
# allow PostScript transparency in epstopdf call # allow PostScript transparency in epstopdf call
./gs-allowpstransparency.patch ./gs-allowpstransparency.patch
# fix curly brace escaping in eukleides.texi for newer texinfo compatiblity
./texinfo-escape.patch
]; ];
nativeBuildInputs = [ nativeBuildInputs = [
bison bison
flex flex
texinfo4 texinfo
makeWrapper makeWrapper
]; ];
@ -41,14 +48,14 @@ stdenv.mkDerivation (finalAttrs: {
preConfigure = '' preConfigure = ''
substituteInPlace Makefile \ substituteInPlace Makefile \
--replace mktexlsr true --replace-fail mktexlsr true
substituteInPlace doc/Makefile \ substituteInPlace doc/Makefile \
--replace ginstall-info install-info --replace-fail ginstall-info install-info
substituteInPlace Config \ substituteInPlace Config \
--replace '/usr/local' "$out" \ --replace-fail '/usr/local' "$out" \
--replace '$(SHARE_DIR)/texmf' "$tex" --replace-fail '$(SHARE_DIR)/texmf' "$tex"
''; '';
# Workaround build failure on -fno-common toolchains like upstream # Workaround build failure on -fno-common toolchains like upstream
@ -57,6 +64,13 @@ stdenv.mkDerivation (finalAttrs: {
# eukleides_build/quadrilateral.o:(.bss+0x18): first defined here # eukleides_build/quadrilateral.o:(.bss+0x18): first defined here
env.NIX_CFLAGS_COMPILE = "-fcommon"; env.NIX_CFLAGS_COMPILE = "-fcommon";
preBuild = ''
mkdir build/eukleides_build
mkdir build/euktopst_build
'';
enableParallelBuilding = true;
preInstall = '' preInstall = ''
mkdir -p $out/bin mkdir -p $out/bin
''; '';
@ -84,6 +98,10 @@ stdenv.mkDerivation (finalAttrs: {
pkgs = [ finalAttrs.finalPackage.tex ]; pkgs = [ finalAttrs.finalPackage.tex ];
}; };
doInstallCheck = true;
nativeInstallCheckInputs = [ versionCheckHook ];
versionCheckProgramArg = "--version";
meta = { meta = {
description = "Geometry Drawing Language"; description = "Geometry Drawing Language";
homepage = "http://www.eukleides.org/"; homepage = "http://www.eukleides.org/";

View file

@ -0,0 +1,19 @@
--- a/doc/eukleides.texi
+++ b/doc/eukleides.texi
@@ -6,12 +6,12 @@
% ------------------------------------------------------------------------------
-\def\LaTeX{L\kern-.34em\raise.49ex\hbox{\sevenrm A}\kern-.18em\TeX}
-\def\mdeg{$^\circ$}
+\def\LaTeX@{L\kern-.34em\raise.49ex\hbox@{\sevenrm A@}\kern-.18em\TeX@}
+\def\mdeg@{$^\circ$@}
\font\degfont=cmtt8
-\def\deg{\raise.7ex\hbox{\degfont o}}
-\def\exm#1{\noindent{\textit Example:}\quad{\texttt #1}}
-\def\exmp{\noindent{\textit Example:}}
+\def\deg@{\raise.7ex\hbox@{\degfont o@}@}
+\def\exm#1@{\noindent@{\textit Example:@}\quad@{\texttt #1@}@}
+\def\exmp@{\noindent@{\textit Example:@}@}
% ------------------------------------------------------------------------------