shithub: treason

Download patch

ref: 87d40c9c17a6e021cdba092b78594cc93ce02ac0
parent: 0e3eb9212fbe8f606399c87f52cb1e9369eb7d94
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Tue Feb 2 11:39:48 EST 2021

add release building

--- a/README.md
+++ b/README.md
@@ -29,10 +29,11 @@
 
 ## Installing/updating
 
-	cd /tmp
-	hget https://git.sr.ht/~ft/treason/archive/mustard.tar.gz | tar xz && \
-	mv treason-mustard treason && \
-	cd treason && ./install.rc
+	rm -rf /tmp/treason
+	mkdir /tmp/treason
+	cd /tmp/treason
+	hget https://ftrv.se/_/treason.gz | gunzip | disk/mkext -d .
+	./treason/install.rc
 
 ## Usage
 
@@ -47,4 +48,4 @@
 
 ## Contact
 
-sigrid on [9gridchan](http://ftrv.se/8) or IRC (freenode/#merveilles).
+sigrid on [9gridchan](http://ftrv.se/8) or IRC (freenode/#cat-v).
--- a/decoder_h264.c
+++ b/decoder_h264.c
@@ -6,7 +6,7 @@
 #include "decoder.h"
 #include "misc.h"
 
-#pragma lib "../openh264/codec/libopenh264.a"
+#pragma lib "../openh264/codec/libopenh264.$M.a"
 
 typedef struct Aux Aux;
 
--- a/decoder_vpx.c
+++ b/decoder_vpx.c
@@ -7,7 +7,7 @@
 #include "decoder.h"
 #include "misc.h"
 
-#pragma lib "../libvpx/libvpx.a"
+#pragma lib "../libvpx/libvpx.$M.a"
 
 typedef struct Aux Aux;
 
--- a/install.rc
+++ b/install.rc
@@ -1,72 +1,8 @@
-#!/bin/rc
+#!/bin/rc -e
 rfork ne
-flag e +
 
-cd ..
+for(d in dav1d faad2 mcfs mcfs/extra openh264 libvpx opus/opus opus/libopusenc opus/opusfile opus/opus-tools)
+	@{cd $d && mk install}
 
-echo downloading and building 3rd party libraries
-test -d dav1d || { hget https://ftrv.se/_/treason3rd.tar.gz | tar xz && \
-	cd dav1d/src && \
-	mk && \
-	cd ../../faad2/libfaad && \
-	mk install && \
-	cd ../frontend && \
-	mk install && \
-	cd ../../openh264/codec && \
-	mk && \
-	cd ../../libvpx && \
-	mk && \
-	cd ..
-}
-
-echo downloading and building mcfs
-test -d mcfs-master || { hget https://git.sr.ht/~ft/mcfs/archive/master.tar.gz | tar xz && \
-	cd mcfs-master && \
-	mk install && \
-	cd ..
-}
-
-echo downloading opus
-test -d opus || { hget https://github.com/xiph/opus/archive/master.tar.gz | tar xz && \
-	mv opus-master opus
-}
-
-echo downloading libopusenc
-test -d libopusenc || { hget https://github.com/xiph/libopusenc/archive/master.tar.gz | tar xz && \
-	mv libopusenc-master libopusenc
-}
-
-echo downloading opusfile
-test -d opusfile || { hget https://github.com/xiph/opusfile/archive/master.tar.gz | tar xz && \
-	mv opusfile-master opusfile
-}
-
-echo downloading opus-tools
-test -d opus-tools || { hget https://github.com/xiph/opus-tools/archive/master.tar.gz | tar xz && \
-	mv opus-tools-master opus-tools
-}
-
-echo downloading alienpatch and building all things opus
-test -d alienpatch || { hget https://github.com/qwx9/alienpatch/archive/master.tar.gz | tar xz && \
-	mv alienpatch-master alienpatch && \
-	for(i in opus libopusenc opusfile opus-tools){ \
-		cd $i; \
-		ape/patch -p0 <../alienpatch/$i || echo failed; \
-		cd ..; \
-	} && \
-	cd opus-tools && ape/patch -p0 <../alienpatch/opus-tools-defaults && \
-	                 ape/patch -p0 <../alienpatch/opus-tools-seek && \
-	cd .. && \
-	for(i in opus libopusenc opusfile opus-tools){ \
-		cd $i; \
-		mk install; \
-		cd ..; \
-	}
-}
-
 echo committing treason
-cd treason && \
-	mk install && \
-	rm -rf ../^(dav1d faad2-master openh264 libvpx mcfs-master opus libopusenc opusfile opus-tools alienpatch)
-
-echo treason has been committed
+cd treason && mk install && echo treason has been committed
--- a/mkfile
+++ b/mkfile
@@ -7,6 +7,7 @@
 
 TARG=treason
 BIN=/$objtype/bin
+CLEANFILES=$TARG.gz
 
 HFILES=\
 	decoder.h\
@@ -29,5 +30,25 @@
 	yuv.$O\
 
 default:V:	all
+
+release:V: $TARG.gz
+
+../opus:
+	mkdir -p ../opus
+	cd ../opus
+	hget https://github.com/qwx9/alienpatch/archive/master.tar.gz | tar zx
+	for(o in opus libopusenc opusfile opus-tools){
+		hget https://github.com/xiph/$o/archive/master.tar.gz | tar zx && \
+		@{mv $o-master $o && cd $o && ape/patch -p0 <../alienpatch-master/$o}
+	}
+	cd opus-tools && \
+		ape/patch -p0 <../alienpatch-master/opus-tools-defaults && \
+		ape/patch -p0 <../alienpatch-master/opus-tools-seek && \
+		cd ..
+	rm -r alienpatch-master
+
+$TARG.gz: ../opus
+	disk/mkfs -a -s .. proto | gzip -9 > $target
+	du -hs $target
 
 </sys/src/cmd/mkone