atom-beta.sh 2.14 KB
Newer Older
1 2 3 4 5 6 7
#!/bin/sh -x

# It will be run with two args: buildroot spec
BUILDROOT="$1"
SPEC="$2"

PRODUCT=atom
8
PRODUCTCUR=atom-beta
Vitaly Lipatov's avatar
Vitaly Lipatov committed
9
PRODUCTDIR=/usr/share/atom-beta
10

11 12
. $(dirname $0)/common-chromium-browser.sh

13 14 15 16 17
# TODO: /usr/share/atom-beta -> /usr/lib64/atom-beta

subst '1iAutoReq:yes,nomonolib,nomono,nopython' $SPEC
subst '1iAutoProv:no' $SPEC

18
add_bin_exec_command $PRODUCT /usr/bin/$PRODUCTCUR
19 20 21 22 23 24

subst '1iBuildRequires:rpm-build-python3' $SPEC
subst '1i%add_python3_path /usr/share/atom-beta' $SPEC

# replace embedded git with standalone (due Can't locate Git/LoadCPAN/Error.pm)
EMBDIR=/usr/share/atom-beta/resources/app.asar.unpacked/node_modules/dugite/git
25 26
echo "Removing $BUILDROOT$EMBDIR/ ..."
rm -r $BUILDROOT$EMBDIR/
27 28 29 30 31 32 33 34
mkdir -p $BUILDROOT$EMBDIR/bin/
ln -s /usr/bin/git $BUILDROOT$EMBDIR/bin/git
subst "s|.*$EMBDIR/libexec/.*||" $SPEC
subst "s|.*$EMBDIR/share/.*||" $SPEC
subst "s|.*$EMBDIR/ssl/.*||" $SPEC

# replace embedded npm with standalone
EMBDIR=/usr/share/atom-beta/resources/app/apm/node_modules/npm
35 36
echo "Removing $BUILDROOT$EMBDIR/ ..."
rm -r $BUILDROOT$EMBDIR/
37 38 39 40 41
ln -s /usr/lib/node_modules/npm $BUILDROOT$EMBDIR
subst "s|.*$EMBDIR/..*\"||" $SPEC

# replace embedded node and npm
for EMBDIR in /usr/share/atom-beta/resources/app/apm/bin/{node,npm} /usr/share/atom-beta/resources/app/apm/node_modules/.bin/{npm,npx} /usr/share/atom-beta/resources/app/apm/node_modules/open/xdg-open ; do
42 43
    echo "Removing $BUILDROOT$EMBDIR ..."
    rm $BUILDROOT$EMBDIR
44 45 46 47 48 49 50 51 52 53 54
    ln -s /usr/bin/$(basename $EMBDIR) $BUILDROOT$EMBDIR
done

# TODO use separated chromium-sandbox
# TODO for other distros?

# install all requires packages before packing (the list have got with rpmreqs package | xargs echo)
epm install --skip-installed coreutils findutils git-core glib2 grep libalsa libatk libat-spi2-core \
            libcairo libcups libdbus libdrm libexpat libgbm libgdk-pixbuf libgio libgtk+3 libnspr libnss libpango libsecret \
            libX11 libxcb libXcomposite libXdamage libXext libXfixes libxkbcommon libxkbfile libXrandr \
            sed /usr/bin/git /usr/bin/node /usr/bin/npm /usr/bin/npx util-linux which xprop \
Vitaly Lipatov's avatar
Vitaly Lipatov committed
55
            node python3 rpm-build-python3
56
# enlightenment exo-utils seamonkey