Remilia's SlackBuild packages for Slackware Linux
Revision | 99f192251be226931fcef8cedda98cf9306e9dae (tree) |
---|---|
Time | 2023-06-12 14:30:09 |
Author | Remilia Scarlet <remilia@post...> |
Commiter | Remilia Scarlet |
Add crystal-lang.
Unlike crystal-lang-bin, this one compiles the compiler from scratch.
@@ -0,0 +1,27 @@ | ||
1 | +Crystal is a programming language with the following goals: | |
2 | + | |
3 | +* Have a syntax similar to Ruby (but compatibility with it is not a goal). | |
4 | +* Statically type-checked but without having to specify the type of variables or | |
5 | + method arguments. | |
6 | +* Be able to call C code by writing bindings to it in Crystal. | |
7 | +* Have compile-time evaluation and generation of code, to avoid boilerplate | |
8 | + code. | |
9 | +* Compile to efficient native code. | |
10 | + | |
11 | +The x86-64 and aarch64 architectures are both supported by this SlackBuild. | |
12 | +This will not build a 32-bit version of Crystal. | |
13 | + | |
14 | +It is strongly suggested to also install my Shards SlackBuild. | |
15 | + | |
16 | +**NOTE 1**: This SlackBuild builds the compiler from scratch and CANNOT be | |
17 | +installed alongside my other SlackBuild, "crystal-lang-bin". Additionally, it | |
18 | +cannot be installed alongside the SlackBuild for crystal-lang on | |
19 | +slackbuilds.org. | |
20 | + | |
21 | +**NOTE 2**: This SlackBuild is **only** supported on Slackware-current at time | |
22 | +of writing! While it will build on 15.0, the resulting compiler will not be | |
23 | +able to build binaries that support multi-threadding. This is because the libgc | |
24 | +that comes with Slackware 15.0 is missing a required feature. | |
25 | + | |
26 | +**NOTE 3**: This uses a statically linked prebuilt binary from Alpine Linux to | |
27 | +bootstrap this process. |
@@ -0,0 +1,135 @@ | ||
1 | +#!/bin/bash | |
2 | + | |
3 | +# Slackware build script for Crystal | |
4 | +# | |
5 | +# Copyright 2023 Remilia Scarlet, Colorado, United States | |
6 | +# All rights reserved. | |
7 | +# | |
8 | +# Redistribution and use of this script, with or without modification, is | |
9 | +# permitted provided that the following conditions are met: | |
10 | +# | |
11 | +# 1. Redistributions of this script must retain the above copyright | |
12 | +# notice, this list of conditions and the following disclaimer. | |
13 | +# | |
14 | +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED | |
15 | +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | |
16 | +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO | |
17 | +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
18 | +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | |
19 | +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; | |
20 | +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | |
21 | +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR | |
22 | +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | |
23 | +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
24 | +cd $(dirname $0) ; CWD=$(pwd) | |
25 | + | |
26 | +PRGNAM=crystal-lang | |
27 | +PRGNAM_SHORT=crystal | |
28 | +VERSION=${VERSION:-1.8.2} | |
29 | +BUILD=${BUILD:-1} | |
30 | +TAG=${TAG:-_SBo} | |
31 | +PKGTYPE=${PKGTYPE:-tgz} | |
32 | + | |
33 | +# Variables for the pre-compiled binary we use to bootstrap things. | |
34 | +PRECOMP_VERSION=${PRECOMP_VERSION:-1.7.3} | |
35 | +PRECOMP_SUFFIX="alpine-linux-musl" | |
36 | + | |
37 | +# Automatically determine the architecture we're building on: | |
38 | +if [ -z "$ARCH" ]; then | |
39 | + case "$( uname -m )" in | |
40 | + i?86) ARCH=i586 ;; | |
41 | + arm*) ARCH=arm ;; | |
42 | + # Unless $ARCH is already set, use uname -m for all other archs: | |
43 | + *) ARCH=$( uname -m ) ;; | |
44 | + esac | |
45 | +fi | |
46 | + | |
47 | +if [ "$ARCH" = "i586" ]; then | |
48 | + echo "Not supported on this architecture via this SlackBuild" | |
49 | + exit 1 | |
50 | +elif [ "$ARCH" = "i686" ]; then | |
51 | + echo "Not supported on this architecture via this SlackBuild" | |
52 | + exit 1 | |
53 | +elif [ "$ARCH" = "x86_64" ]; then | |
54 | + SLKCFLAGS="-O2 -fPIC" | |
55 | + LIBDIRSUFFIX="64" | |
56 | + PRECOMP_ARCH="x86_64" | |
57 | +elif [ "$ARCH" = "aarch64" ]; then | |
58 | + SLKCFLAGS="-O2 -fPIC" | |
59 | + LIBDIRSUFFIX="64" | |
60 | + PRECOMP_ARCH="aarch64" | |
61 | +else | |
62 | + echo "Not supported on this architecture via this SlackBuild" | |
63 | + exit 1 | |
64 | +fi | |
65 | + | |
66 | +# If the variable PRINT_PACKAGE_NAME is set, then this script will report what | |
67 | +# the name of the created package would be, and then exit. This information | |
68 | +# could be useful to other scripts. | |
69 | +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then | |
70 | + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" | |
71 | + exit 0 | |
72 | +fi | |
73 | + | |
74 | +TMP=${TMP:-/tmp/SBo} | |
75 | +PKG=$TMP/package-$PRGNAM | |
76 | +OUTPUT=${OUTPUT:-/tmp} | |
77 | + | |
78 | +set -e # Exit on most errors | |
79 | + | |
80 | +rm -rf $PKG | |
81 | +mkdir -p $TMP $PKG $OUTPUT | |
82 | +cd $TMP | |
83 | +rm -rf $PRGNAM_SHORT-$VERSION | |
84 | +tar xvf $CWD/$PRGNAM_SHORT-$VERSION.tar.gz | |
85 | +cd $PRGNAM_SHORT-$VERSION | |
86 | + | |
87 | +# Unpack the pre-compiled binary that we'll use for bootstrapping. | |
88 | +tar xvf $CWD/$PRGNAM_SHORT-$PRECOMP_VERSION-$PRECOMP_ARCH-$PRECOMP_SUFFIX.tar.gz | |
89 | + | |
90 | +chown -R root:root . | |
91 | +find -L . \ | |
92 | + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ | |
93 | + -o -perm 511 \) -exec chmod 755 {} \; -o \ | |
94 | + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ | |
95 | + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; | |
96 | + | |
97 | +# Change the path so that we use the pre-compiled binary for bootstrapping. | |
98 | +PATH="$PRGNAM_SHORT-$PRECOMP_VERSION-$PRECOMP_ARCH-$PRECOMP_SUFFIX/bin:$PATH" | |
99 | + | |
100 | +# Build the compiler | |
101 | +CFLAGS="$SLKCFLAGS" \ | |
102 | + make release=1 progress=1 interpreter=1 | |
103 | +make install PREFIX=/usr DESTDIR=$PKG | |
104 | + | |
105 | +# Fix some installation directories | |
106 | +mv -v $PKG/usr/share/man $PKG/usr/man | |
107 | + | |
108 | +# Strip binaries and libraries - this can be done with 'make install-strip' | |
109 | +# in many source trees, and that's usually acceptable if so, but if not, | |
110 | +# use this: | |
111 | +find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ | |
112 | + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true | |
113 | + | |
114 | +# Copy program documentation into the package | |
115 | +# The included documentation varies from one application to another, so be sure | |
116 | +# to adjust your script as needed | |
117 | +# Also, include the SlackBuild script in the documentation directory | |
118 | +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION | |
119 | +cp -a README.md $PKG/usr/doc/$PRGNAM-$VERSION | |
120 | +cp -a CHANGELOG.md $PKG/usr/doc/$PRGNAM-$VERSION | |
121 | +mv -v $PKG/usr/share/licenses/crystal/LICENSE $PKG/usr/doc/$PRGNAM-$VERSION | |
122 | +rmdir $PKG/usr/share/licenses/crystal # Not needed | |
123 | +rmdir $PKG/usr/share/licenses # Not needed | |
124 | +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild | |
125 | + | |
126 | +# Copy the slack-desc into ./install | |
127 | +mkdir -p $PKG/install | |
128 | +cat $CWD/slack-desc > $PKG/install/slack-desc | |
129 | + | |
130 | +# Make the package; be sure to leave it in $OUTPUT | |
131 | +# If package symlinks need to be created during install *before* | |
132 | +# your custom contents of doinst.sh runs, then add the -p switch to | |
133 | +# the makepkg command below -- see makepkg(8) for details | |
134 | +cd $PKG | |
135 | +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE |
@@ -0,0 +1,16 @@ | ||
1 | +PRGNAM="crystal-lang" | |
2 | +VERSION="1.8.2" | |
3 | +HOMEPAGE="https://crystal-lang.org" | |
4 | +DOWNLOAD="UNSUPPORTED" | |
5 | +MD5SUM="" | |
6 | +DOWNLOAD_x86_64="https://github.com/crystal-lang/crystal/archive/refs/tags/1.8.2.tar.gz \ | |
7 | + https://dev.alpinelinux.org/archive/crystal/crystal-1.7.3-x86_64-alpine-linux-musl.tar.gz" | |
8 | +MD5SUM_x86_64="817499a459e5ad6ff21c9245f1573016 \ | |
9 | + 7d54ec9bfb464bc2b8b41bf2ea488a30" | |
10 | +DOWNLOAD_aarch64="https://github.com/crystal-lang/crystal/archive/refs/tags/1.8.2.tar.gz \ | |
11 | + https://dev.alpinelinux.org/archive/crystal/crystal-1.7.3-aarch64-alpine-linux-musl.tar.gz" | |
12 | +MD5SUM_aarch64="817499a459e5ad6ff21c9245f1573016 \ | |
13 | + f5905f49daf419cf1ffab4a8329847d5" | |
14 | +REQUIRES="" | |
15 | +MAINTAINER="Remilia Scarlet" | |
16 | +EMAIL="remilia@sdf.org" |
@@ -0,0 +1,19 @@ | ||
1 | +# HOW TO EDIT THIS FILE: | |
2 | +# The "handy ruler" below makes it easier to edit a package description. | |
3 | +# Line up the first '|' above the ':' following the base package name, and | |
4 | +# the '|' on the right side marks the last column you can put a character in. | |
5 | +# You must make exactly 11 lines for the formatting to be correct. It's also | |
6 | +# customary to leave one space after the ':' except on otherwise blank lines. | |
7 | + | |
8 | + |-----handy-ruler------------------------------------------------------| | |
9 | +crystal-lang: crystal-lang (a compiled Ruby-like language with static typing) | |
10 | +crystal-lang: | |
11 | +crystal-lang: Crystal is a statically typed programming language with Ruby-like | |
12 | +crystal-lang: syntax, and built on an LLVM backend. | |
13 | +crystal-lang: | |
14 | +crystal-lang: This is a repackaging of the official pre-compiled binaries. | |
15 | +crystal-lang: | |
16 | +crystal-lang: | |
17 | +crystal-lang: | |
18 | +crystal-lang: Homepage: https://crystal-lang.org/ | |
19 | +crystal-lang: | |
\ No newline at end of file |