commit
0e9237acba
@ -1,45 +1,88 @@ |
||||
{ lib, stdenv, fetchurl, bison }: |
||||
{ lib, stdenv, fetchurl, bison, buildPackages }: |
||||
|
||||
stdenv.mkDerivation rec { |
||||
pname = "jam"; |
||||
version = "2.6.1"; |
||||
let |
||||
mkJam = { meta ? { }, ... } @ args: stdenv.mkDerivation (args // { |
||||
depsBuildBuild = [ buildPackages.stdenv.cc ]; |
||||
nativeBuildInputs = [ bison ]; |
||||
|
||||
src = fetchurl { |
||||
url = "https://swarm.workshop.perforce.com/projects/perforce_software-jam/download/main/${pname}-${version}.tar"; |
||||
sha256 = "19xkvkpycxfsncxvin6yqrql3x3z9ypc1j8kzls5k659q4kv5rmc"; |
||||
}; |
||||
# Jambase expects ar to have flags. |
||||
preConfigure = '' |
||||
export AR="$AR rc" |
||||
''; |
||||
|
||||
LOCATE_TARGET = "bin.unix"; |
||||
|
||||
nativeBuildInputs = [ bison ]; |
||||
buildPhase = '' |
||||
runHook preBuild |
||||
make $makeFlags jam0 |
||||
./jam0 -j$NIX_BUILD_CORES -sCC=${buildPackages.stdenv.cc.targetPrefix}cc jambase.c |
||||
./jam0 -j$NIX_BUILD_CORES |
||||
runHook postBuild |
||||
''; |
||||
|
||||
preConfigure = '' |
||||
unset AR |
||||
''; |
||||
installPhase = '' |
||||
runHook preInstall |
||||
mkdir -p $out/bin $out/doc/jam |
||||
cp bin.unix/jam $out/bin/jam |
||||
cp *.html $out/doc/jam |
||||
runHook postInstall |
||||
''; |
||||
|
||||
buildPhase = '' |
||||
runHook preBuild |
||||
enableParallelBuilding = true; |
||||
|
||||
make jam0 |
||||
meta = with lib; meta // { |
||||
license = licenses.free; |
||||
mainProgram = "jam"; |
||||
platforms = platforms.unix; |
||||
}; |
||||
}); |
||||
in |
||||
{ |
||||
jam = let |
||||
pname = "jam"; |
||||
version = "2.6.1"; |
||||
in mkJam { |
||||
inherit pname version; |
||||
|
||||
runHook postBuild |
||||
''; |
||||
src = fetchurl { |
||||
url = "https://swarm.workshop.perforce.com/projects/perforce_software-jam/download/main/${pname}-${version}.tar"; |
||||
sha256 = "19xkvkpycxfsncxvin6yqrql3x3z9ypc1j8kzls5k659q4kv5rmc"; |
||||
}; |
||||
|
||||
meta = with lib; { |
||||
description = "Just Another Make"; |
||||
homepage = "https://www.perforce.com/resources/documentation/jam"; |
||||
maintainers = with maintainers; [ impl orivej ]; |
||||
}; |
||||
}; |
||||
|
||||
installPhase = '' |
||||
runHook preInstall |
||||
ftjam = let |
||||
pname = "ftjam"; |
||||
version = "2.5.2"; |
||||
in mkJam { |
||||
inherit pname version; |
||||
|
||||
./jam0 -j$NIX_BUILD_CORES -sBINDIR=$out/bin install |
||||
mkdir -p $out/doc/jam |
||||
cp *.html $out/doc/jam |
||||
src = fetchurl { |
||||
url = "https://downloads.sourceforge.net/project/freetype/${pname}/${version}/${pname}-${version}.tar.bz2"; |
||||
hash = "sha256-6JdzUAqSkS3pGOn+v/q+S2vOedaa8ZRDX04DK4ptZqM="; |
||||
}; |
||||
|
||||
runHook postInstall |
||||
''; |
||||
postPatch = '' |
||||
substituteInPlace Jamfile --replace strip ${stdenv.cc.targetPrefix}strip |
||||
''; |
||||
|
||||
enableParallelBuilding = true; |
||||
# Doesn't understand how to cross compile once bootstrapped, so we'll just |
||||
# use the Makefile for the bootstrapping portion. |
||||
configurePlatforms = [ "build" "target" ]; |
||||
configureFlags = [ |
||||
"CC=${buildPackages.stdenv.cc.targetPrefix}cc" |
||||
"--host=${stdenv.buildPlatform.config}" |
||||
]; |
||||
|
||||
meta = with lib; { |
||||
homepage = "https://www.perforce.com/resources/documentation/jam"; |
||||
license = licenses.free; |
||||
description = "Just Another Make"; |
||||
maintainers = with maintainers; [ orivej ]; |
||||
platforms = platforms.unix; |
||||
meta = with lib; { |
||||
description = "FreeType's enhanced, backwards-compatible Jam clone"; |
||||
homepage = "https://freetype.org/jam/"; |
||||
maintainers = with maintainers; [ AndersonTorres impl ]; |
||||
}; |
||||
}; |
||||
} |
||||
|
@ -1,53 +0,0 @@ |
||||
{ lib |
||||
, stdenv |
||||
, fetchurl |
||||
, bison |
||||
}: |
||||
|
||||
stdenv.mkDerivation rec { |
||||
pname = "ftjam"; |
||||
version = "2.5.2"; |
||||
|
||||
src = fetchurl { |
||||
url = "https://downloads.sourceforge.net/project/freetype/${pname}/${version}/${pname}-${version}.tar.bz2"; |
||||
hash = "sha256-6JdzUAqSkS3pGOn+v/q+S2vOedaa8ZRDX04DK4ptZqM="; |
||||
}; |
||||
|
||||
nativeBuildInputs = [ |
||||
bison |
||||
]; |
||||
|
||||
preConfigure = '' |
||||
unset AR |
||||
''; |
||||
|
||||
buildPhase = '' |
||||
runHook preBuild |
||||
|
||||
make jam0 |
||||
|
||||
runHook postBuild |
||||
''; |
||||
|
||||
installPhase = '' |
||||
runHook preInstall |
||||
|
||||
./jam0 -j$NIX_BUILD_CORES -sBINDIR=$out/bin install |
||||
mkdir -p $out/doc/jam |
||||
cp *.html $out/doc/jam |
||||
|
||||
runHook postInstall |
||||
''; |
||||
|
||||
enableParallelBuilding = true; |
||||
|
||||
meta = with lib; { |
||||
description = "Freetype's enhanced, backwards-compatible Jam clone"; |
||||
homepage = "https://freetype.org/jam/"; |
||||
license = licenses.free; |
||||
maintainers = with maintainers; [ AndersonTorres ]; |
||||
mainProgram = "jam"; |
||||
platforms = platforms.unix; |
||||
}; |
||||
} |
||||
# TODO: setup hook for Jam |
@ -0,0 +1,214 @@ |
||||
Author: DuckSoft <realducksoft@gmail.com>
|
||||
|
||||
I just cannot stand such a dirty package.
|
||||
Let me do some optimisations.
|
||||
|
||||
If you are interested to improve this patch, welcome to mail me.
|
||||
|
||||
diff -rup old/tool/ventoy_lib.sh new/tool/ventoy_lib.sh
|
||||
--- tool/ventoy_lib.sh 2021-12-02 16:59:42.148650182 +0100
|
||||
+++ tool/ventoy_lib.sh 2021-12-02 17:01:17.214720518 +0100
|
||||
@@ -29,7 +29,7 @@ vterr() {
|
||||
}
|
||||
|
||||
vtdebug() {
|
||||
- echo "$*" >> ./log.txt
|
||||
+ echo "$*" >>/var/log/ventoy.log
|
||||
}
|
||||
|
||||
vtoy_gen_uuid() {
|
||||
@@ -52,30 +52,6 @@ vtoy_gen_uuid() {
|
||||
|
||||
check_tool_work_ok() {
|
||||
|
||||
- if echo 1 | hexdump > /dev/null; then
|
||||
- vtdebug "hexdump test ok ..."
|
||||
- else
|
||||
- vtdebug "hexdump test fail ..."
|
||||
- ventoy_false
|
||||
- return
|
||||
- fi
|
||||
-
|
||||
- if mkexfatfs -V > /dev/null; then
|
||||
- vtdebug "mkexfatfs test ok ..."
|
||||
- else
|
||||
- vtdebug "mkexfatfs test fail ..."
|
||||
- ventoy_false
|
||||
- return
|
||||
- fi
|
||||
-
|
||||
- if vtoycli fat -T; then
|
||||
- vtdebug "vtoycli fat test ok ..."
|
||||
- else
|
||||
- vtdebug "vtoycli fat test fail ..."
|
||||
- ventoy_false
|
||||
- return
|
||||
- fi
|
||||
-
|
||||
vtdebug "tool check success ..."
|
||||
ventoy_true
|
||||
}
|
||||
@@ -311,7 +287,7 @@ format_ventoy_disk_mbr() {
|
||||
else
|
||||
vtdebug "format disk by fdisk ..."
|
||||
|
||||
-fdisk $DISK >>./log.txt 2>&1 <<EOF
|
||||
+fdisk $DISK >>/var/log/ventoy.log 2>&1 <<EOF
|
||||
o
|
||||
n
|
||||
p
|
||||
diff -rup old/tool/VentoyWorker.sh new/tool/VentoyWorker.sh
|
||||
--- tool/VentoyWorker.sh 2021-12-02 16:59:31.485642239 +0100
|
||||
+++ tool/VentoyWorker.sh 2021-12-02 17:02:00.326752183 +0100
|
||||
@@ -105,7 +105,7 @@ vtdebug "MODE=$MODE FORCE=$FORCE RESERVE
|
||||
if check_tool_work_ok; then
|
||||
vtdebug "check tool work ok"
|
||||
else
|
||||
- vterr "Some tools can not run on current system. Please check log.txt for details."
|
||||
+ vterr "Some tools can not run on current system. Please check /var/log/ventoy.log for details."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
diff -rup old/Ventoy2Disk.sh new/Ventoy2Disk.sh
|
||||
--- Ventoy2Disk.sh 2021-12-02 16:59:05.205622608 +0100
|
||||
+++ Ventoy2Disk.sh 2021-12-02 17:03:29.037816991 +0100
|
||||
@@ -32,48 +32,4 @@ echo " https://www.ventoy.net"
|
||||
echo '**********************************************'
|
||||
echo ''
|
||||
|
||||
-
|
||||
-if ! [ -f ./boot/boot.img ]; then
|
||||
- if [ -d ./grub ]; then
|
||||
- echo "Don't run Ventoy2Disk.sh here, please download the released install package, and run the script in it."
|
||||
- else
|
||||
- echo "Please run under the correct directory!"
|
||||
- fi
|
||||
- exit 1
|
||||
-fi
|
||||
-
|
||||
-echo "############# Ventoy2Disk $* [$TOOLDIR] ################" >> ./log.txt
|
||||
-date >> ./log.txt
|
||||
-
|
||||
-#decompress tool
|
||||
-echo "decompress tools" >> ./log.txt
|
||||
-cd ./tool/$TOOLDIR
|
||||
-
|
||||
-ls *.xz > /dev/null 2>&1
|
||||
-if [ $? -eq 0 ]; then
|
||||
- [ -f ./xzcat ] && chmod +x ./xzcat
|
||||
-
|
||||
- for file in $(ls *.xz); do
|
||||
- echo "decompress $file" >> ./log.txt
|
||||
- xzcat $file > ${file%.xz}
|
||||
- [ -f ./${file%.xz} ] && chmod +x ./${file%.xz}
|
||||
- [ -f ./$file ] && rm -f ./$file
|
||||
- done
|
||||
-fi
|
||||
-
|
||||
-cd ../../
|
||||
-chmod +x -R ./tool/$TOOLDIR
|
||||
-
|
||||
-
|
||||
-if [ -f /bin/bash ]; then
|
||||
- /bin/bash ./tool/VentoyWorker.sh $*
|
||||
-else
|
||||
- ash ./tool/VentoyWorker.sh $*
|
||||
-fi
|
||||
-
|
||||
-if [ -n "$OLDDIR" ]; then
|
||||
- CURDIR=$(pwd)
|
||||
- if [ "$CURDIR" != "$OLDDIR" ]; then
|
||||
- cd "$OLDDIR"
|
||||
- fi
|
||||
-fi
|
||||
+./tool/VentoyWorker.sh $*
|
||||
diff -rup old/VentoyPlugson.sh new/VentoyPlugson.sh
|
||||
--- VentoyPlugson.sh 2021-12-02 17:54:36.055868878 +0100
|
||||
+++ VentoyPlugson.sh 2021-12-02 18:04:40.919633986 +0100
|
||||
@@ -25,8 +19,6 @@ if echo $machine | egrep -q 'aarch64|arm
|
||||
TOOLDIR=aarch64
|
||||
elif echo $machine | egrep -q 'x86_64|amd64'; then
|
||||
TOOLDIR=x86_64
|
||||
-elif echo $machine | egrep -q 'mips64'; then
|
||||
- TOOLDIR=mips64el
|
||||
elif echo $machine | egrep -q 'i[3-6]86'; then
|
||||
TOOLDIR=i386
|
||||
else
|
||||
@@ -35,38 +27,6 @@ else
|
||||
fi
|
||||
|
||||
|
||||
-if ! [ -f "$OLDDIR/tool/plugson.tar.xz" ]; then
|
||||
- echo "Please run under the correct directory!"
|
||||
- exit 1
|
||||
-fi
|
||||
-
|
||||
-echo "############# VentoyPlugson $* [$TOOLDIR] ################" >> ./VentoyPlugson.log
|
||||
-date >> ./VentoyPlugson.log
|
||||
-
|
||||
-echo "decompress tools" >> ./VentoyPlugson.log
|
||||
-cd ./tool/$TOOLDIR
|
||||
-
|
||||
-ls *.xz > /dev/null 2>&1
|
||||
-if [ $? -eq 0 ]; then
|
||||
- [ -f ./xzcat ] && chmod +x ./xzcat
|
||||
-
|
||||
- for file in $(ls *.xz); do
|
||||
- echo "decompress $file" >> ./VentoyPlugson.log
|
||||
- xzcat $file > ${file%.xz}
|
||||
- [ -f ./${file%.xz} ] && chmod +x ./${file%.xz}
|
||||
- [ -f ./$file ] && rm -f ./$file
|
||||
- done
|
||||
-fi
|
||||
-
|
||||
-cd ../../
|
||||
-chmod +x -R ./tool/$TOOLDIR
|
||||
-
|
||||
-if ! [ -f "$OLDDIR/tool/$TOOLDIR/Plugson" ]; then
|
||||
- echo "$OLDDIR/tool/$TOOLDIR/Plugson does not exist!"
|
||||
- exit 1
|
||||
-fi
|
||||
-
|
||||
-
|
||||
PATH=./tool/$TOOLDIR:$PATH
|
||||
|
||||
HOST="127.0.0.1"
|
||||
@@ -208,11 +168,3 @@ if [ -f /proc/$wID/maps ]; then
|
||||
|
||||
wait $wID
|
||||
fi
|
||||
-
|
||||
-
|
||||
-if [ -n "$OLDDIR" ]; then
|
||||
- CURDIR=$(pwd)
|
||||
- if [ "$CURDIR" != "$OLDDIR" ]; then
|
||||
- cd "$OLDDIR"
|
||||
- fi
|
||||
-fi
|
||||
diff -rup old/VentoyWeb.sh new/VentoyWeb.sh
|
||||
--- VentoyWeb.sh 2021-12-02 16:58:51.885612627 +0100
|
||||
+++ VentoyWeb.sh 2021-12-02 17:04:43.437871014 +0100
|
||||
@@ -15,12 +15,6 @@ print_err() {
|
||||
echo ""
|
||||
}
|
||||
|
||||
-uid=$(id -u)
|
||||
-if [ $uid -ne 0 ]; then
|
||||
- print_err "Please use sudo or run the script as root."
|
||||
- exit 1
|
||||
-fi
|
||||
-
|
||||
OLDDIR=$(pwd)
|
||||
|
||||
if uname -m | egrep -q 'aarch64|arm64'; then
|
||||
@@ -85,8 +79,8 @@ if ps -ef | grep "V2DServer.*$HOST.*$POR
|
||||
exit 1
|
||||
fi
|
||||
|
||||
-LOGFILE=log.txt
|
||||
-#delete the log.txt if it's more than 8MB
|
||||
+LOGFILE=/var/log/ventoy.log
|
||||
+#delete the ventoy.log if it's more than 8MB
|
||||
if [ -f $LOGFILE ]; then
|
||||
logsize=$(stat -c '%s' $LOGFILE)
|
||||
if [ $logsize -gt 8388608 ]; then
|
Loading…
Reference in new issue