From 8f5f75dae538eb5a85053217566725207e268c14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Thu, 3 Sep 2020 22:28:47 +0700 Subject: [PATCH] scratch: honour our hardening flags --- srcpkgs/scratch/template | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/srcpkgs/scratch/template b/srcpkgs/scratch/template index 7de1c5398ae..fea6cc07aff 100644 --- a/srcpkgs/scratch/template +++ b/srcpkgs/scratch/template @@ -1,27 +1,35 @@ # Template file for 'scratch' pkgname=scratch version=1.4.0.7 -revision=1 +revision=2 wrksrc="${pkgname}-${version}.src" +build_style=gnu-makefile hostmakedepends="pkg-config" makedepends="squeak pango-devel shared-mime-info desktop-file-utils gtk-update-icon-cache" depends="${makedepends/pango-devel/}" short_desc="Create and share your own interactive stories, games, music and art" maintainer="Orphaned " -license="GPL-2" +license="GPL-2.0-only, MIT" homepage="http://scratch.mit.edu" distfiles="http://download.scratch.mit.edu/${pkgname}-${version}.src.tar.gz" checksum=b94d89278ecef2ba2d1147eec23936dd99697293ffa2c216c0a375ba98226a3e -do_build() { - make CC=$CC CFLAGS="$CFLAGS" ${makejobs} build +post_patch() { + sed -n -e '/Author:/,/IN THE SOFTWARE/p' \ + src/plugins/wedo/WeDoLinux.c >LICENSE.MIT + find . -name Makefile -exec \ + sed -i -e ' + /gcc.*CFLAGS/s/gcc/$(CC) $(CPPFLAGS)/ + /gcc -shared/s/gcc/$(CC) $(LDFLAGS)/ + ' {} + } + do_install() { vbin src/scratch vinstall Scratch.image 644 usr/lib/scratch vinstall Scratch.ini 644 usr/lib/scratch vinstall src/scratch.desktop 644 usr/share/applications - vinstall src/man/scratch.1.gz 644 usr/share/man/man1 + vman src/man/scratch.1.gz vinstall src/scratch.xml 644 usr/share/mime/packages install -dm755 ${DESTDIR}/usr/share/{scratch,icons/hicolor} @@ -32,4 +40,6 @@ do_install() { install -D -m644 src/icons/${res}x${res}/scratch.png \ ${DESTDIR}/usr/share/icons/hicolor/${res}x${res}/apps/scratch.png done + vlicense NOTICE + vlicense LICENSE.MIT }