diff options
author | Teoh Han Hui | 2021-04-05 17:54:36 +0800 |
---|---|---|
committer | Teoh Han Hui | 2021-04-05 17:54:36 +0800 |
commit | c0ef7ece70275a8f09d26a3059f98dd6b3a94d97 (patch) | |
tree | a352071e270777cbe5b037676a34c11eb6c751f6 | |
parent | 4898ed40dec535f61355a5c8671d3177954f3364 (diff) | |
download | aur-c0ef7ece70275a8f09d26a3059f98dd6b3a94d97.tar.gz |
Install to /opt/makepad
-rw-r--r-- | .SRCINFO | 6 | ||||
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | PKGBUILD | 22 | ||||
-rw-r--r-- | adjust-makepad-workspace.patch | 13 | ||||
-rw-r--r-- | adjust-resources-path.patch | 19 |
5 files changed, 48 insertions, 14 deletions
@@ -1,6 +1,6 @@ pkgbase = makepad-git pkgdesc = VR, web and native collaborative shader programming environment - pkgver = 0.1.0.r827.8dfad9ff + pkgver = 0.1.0.r883.5c05e153 pkgrel = 1 url = https://github.com/makepad/makepad arch = i686 @@ -14,9 +14,11 @@ pkgbase = makepad-git provides = makepad conflicts = makepad source = makepad-git::git+https://github.com/makepad/makepad#branch=master + source = adjust-makepad-workspace.patch source = adjust-resources-path.patch sha256sums = SKIP - sha256sums = 8b638b723e1b3d6f1d71a6f67cde2de48973e737d2f22fbab39bc18d2b874933 + sha256sums = 29a82f1366817901481757fb2c9cab1f72eae80758e179b0d0342992334da3b9 + sha256sums = 83f66d95a06b46a975171eea9ba32f50c1b3529f68257f820a455c39d9bc5601 pkgname = makepad-git diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 62d30f9218cb..000000000000 --- a/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -src/ -pkg/ @@ -2,7 +2,7 @@ _pkgname=makepad pkgname=makepad-git -pkgver=0.1.0.r827.8dfad9ff +pkgver=0.1.0.r883.5c05e153 pkgrel=1 pkgdesc='VR, web and native collaborative shader programming environment' arch=('i686' 'x86_64') @@ -14,37 +14,45 @@ provides=('makepad') conflicts=('makepad') source=("${pkgname}::git+https://github.com/makepad/makepad#branch=master" + 'adjust-makepad-workspace.patch' 'adjust-resources-path.patch') sha256sums=('SKIP' - '8b638b723e1b3d6f1d71a6f67cde2de48973e737d2f22fbab39bc18d2b874933') + '29a82f1366817901481757fb2c9cab1f72eae80758e179b0d0342992334da3b9' + '83f66d95a06b46a975171eea9ba32f50c1b3529f68257f820a455c39d9bc5601') prepare() { cd "${srcdir}/${pkgname}" + for patch in "${srcdir}/"*.patch; do - sed -i -e "s#%%USR_SHARE_PKG%%#${pkgdir}/usr/share/${_pkgname}#g" "${patch}" + sed -i -e "s#%%MAKEPAD_HOME%%#/opt/${_pkgname}#g" "${patch}" patch -p1 -i "${patch}" done } pkgver() { cd "${srcdir}/${pkgname}" + printf "%s.r%s.%s" "$(grep '^version =' makepad/Cargo.toml | head -n1 | cut -d\" -f2 | cut -d- -f1)" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" } build() { cd "${srcdir}/${pkgname}" + cargo build --release --package "${_pkgname}" } check() { cd "${srcdir}/${pkgname}" + cargo test --release --package "${_pkgname}" } package() { cd "${srcdir}/${pkgname}" - install -D -m 755 target/release/${_pkgname} -t "${pkgdir}/usr/bin" - mkdir -p "${pkgdir}/usr/share/${_pkgname}/resources" - install -D -m 644 resources/* -t "${pkgdir}/usr/share/${_pkgname}/resources" - install -D -m 644 LICENSE "${pkgdir}/usr/share/licenses/${_pkgname}/LICENSE" + + install -Dm755 "target/release/${_pkgname}" "${pkgdir}/opt/${_pkgname}/target/release/${_pkgname}" + install -d "${pkgdir}/usr/bin" + ln -s "/opt/${_pkgname}/target/release/${_pkgname}" "${pkgdir}/usr/bin/${_pkgname}" + find . \( -path ./.git -o -path ./.github -o -path ./target \) -prune -o -type f -exec install -Dm644 "{}" "${pkgdir}/opt/${_pkgname}/{}" \; + install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${_pkgname}/LICENSE" } diff --git a/adjust-makepad-workspace.patch b/adjust-makepad-workspace.patch new file mode 100644 index 000000000000..6d67b6774825 --- /dev/null +++ b/adjust-makepad-workspace.patch @@ -0,0 +1,13 @@ +diff --git a/makepad/app/src/makepadstorage.rs b/makepad/app/src/makepadstorage.rs +index ce8be4b..e3ccacc 100644 +--- a/makepad/app/src/makepadstorage.rs ++++ b/makepad/app/src/makepadstorage.rs +@@ -51,7 +51,7 @@ impl MakepadSettings { + http_server: HttpServerConfig::Localhost(8000), + workspaces: { + let mut workspace = HashMap::new(); +- workspace.insert("makepad".to_string(), ".".to_string()); ++ workspace.insert("makepad".to_string(), "%%MAKEPAD_HOME%%".to_string()); + workspace + } + }); diff --git a/adjust-resources-path.patch b/adjust-resources-path.patch index 6421d719646f..2866abf17730 100644 --- a/adjust-resources-path.patch +++ b/adjust-resources-path.patch @@ -1,5 +1,18 @@ +diff --git a/render/src/drawtext.rs b/render/src/drawtext.rs +index b10d855..33ff5b5 100644 +--- a/render/src/drawtext.rs ++++ b/render/src/drawtext.rs +@@ -134,7 +134,7 @@ impl DrawText { + + live_body!(cx, r#" + self::text_style_unscaled: TextStyle { +- font: "resources/Ubuntu-R.ttf", ++ font: "%%MAKEPAD_HOME%%/resources/Ubuntu-R.ttf", + font_size: 8.0, + brightness: 1.0, + curve: 0.6, diff --git a/widget/src/widgetstyle.rs b/widget/src/widgetstyle.rs -index eb235fd..815845e 100644 +index eb235fd..4d607b0 100644 --- a/widget/src/widgetstyle.rs +++ b/widget/src/widgetstyle.rs @@ -4,7 +4,7 @@ pub fn set_widget_style(cx: &mut Cx) { @@ -7,7 +20,7 @@ index eb235fd..815845e 100644 live_body!(cx, r#" self::text_style_unscaled: TextStyle{ - font: "resources/Ubuntu-R.ttf", -+ font: "%%USR_SHARE_PKG%%/resources/Ubuntu-R.ttf", ++ font: "%%MAKEPAD_HOME%%/resources/Ubuntu-R.ttf", font_size: 8.0, brightness: 1.0, curve: 0.6, @@ -16,7 +29,7 @@ index eb235fd..815845e 100644 self::text_style_fixed: TextStyle{ - font: "resources/LiberationMono-Regular.ttf", -+ font: "%%USR_SHARE_PKG%%/resources/LiberationMono-Regular.ttf", ++ font: "%%MAKEPAD_HOME%%/resources/LiberationMono-Regular.ttf", brightness: 1.1, font_size: 8.0, line_spacing: 1.8, |