Skip to content

Instantly share code, notes, and snippets.

@prof7bit
Last active September 11, 2018 06:47
Show Gist options
  • Save prof7bit/4e9206bd7c6bb9e8abf42baa1f71e82c to your computer and use it in GitHub Desktop.
Save prof7bit/4e9206bd7c6bb9e8abf42baa1f71e82c to your computer and use it in GitHub Desktop.
Install fpc 3.0-fixes and Lazarus 1.6-fixes on Debian completely from Source
#!/usr/bin/python3
import os
LAZDIR = os.path.expanduser("~/lazsvn")
print(LAZDIR)
exit
def shell(cmd):
if os.system(cmd) != 0:
raise
try:
# install some prerequisites
shell("sudo apt -y install subversion curl rpm2cpio libgtk2.0-dev gdb")
shell("mkdir -p {}".format(LAZDIR))
shell("svn co https://svn.freepascal.org/svn/fpc/branches/fixes_3_0 {}/fpc".format(LAZDIR))
shell("svn co https://svn.freepascal.org/svn/lazarus/branches/fixes_1_8/ {}/lazarus".format(LAZDIR))
# download and extract bootstrap cpompiler
try:
shell("rpm2cpio {0}/fpc.rpm | cpio -iv --to-stdout ./usr/lib64/fpc/3.0.0/ppcx64 > {0}/ppcx64".format(LAZDIR))
except:
shell("curl ftp://ftp.freepascal.org/pub/fpc/dist/3.0.0/x86_64-linux/rpm/fpc-3.0.0-1.x86_64.rpm > {0}/fpc.rpm".format(LAZDIR))
shell("rpm2cpio {0}/fpc.rpm | cpio -iv --to-stdout ./usr/lib64/fpc/3.0.0/ppcx64 > {0}/ppcx64".format(LAZDIR))
shell("chmod +x {0}/ppcx64".format(LAZDIR))
# compile fpc
shell("cd {0}/fpc && make clean all PP={0}/ppcx64 OVERRIDEVERSIONCHECK=1".format(LAZDIR))
shell("cd {0}/fpc && sudo make install PP={0}/ppcx64 OVERRIDEVERSIONCHECK=1".format(LAZDIR))
shell("cd {0}/fpc/compiler && sudo make installsymlink PP={0}/ppcx64 OVERRIDEVERSIONCHECK=1".format(LAZDIR))
shell("sudo /usr/local/lib/fpc/3.0.5/samplecfg /usr/local/lib/fpc/3.0.5/ /etc")
# compile lazarus
shell("cd {0}/lazarus/ && make clean lazbuild useride starter".format(LAZDIR))
shell("sudo ln -sf {0}/lazarus/startlazarus /usr/local/bin/lazarus".format(LAZDIR))
print("SUCCESS")
except:
print("FAIL")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment