The Birdfont Source Code


All Repositories / birdfont.git / blob – RSS feed

snap.py in scripts

This file is a part of the Birdfont project.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git

Revisions

View the latest version of scripts/snap.py.
Merge ../birdfont-2.x
1 #!/usr/bin/python3 2 import version 3 from optparse import OptionParser 4 5 parser = OptionParser() 6 parser.add_option('-f', '--free', dest='free', action="store_true", help="generate non-commercial version") 7 (options, args) = parser.parse_args() 8 9 template = open('./scripts/snapcraft.yaml', 'r') 10 yaml = template.read(); 11 12 if options.free: 13 v = version.VERSION + "-free" 14 else: 15 v = version.VERSION 16 17 yaml = yaml.replace("VERSION", v) 18 19 make_script = open('./build/snapsource/birdfont/Makefile', 'w+') 20 make_script.write("#Don't edit, the file is generated by a script\n") 21 make_script.write("all:\n") 22 23 if options.free: 24 make_script.write ("\t./configure --valac-flags=\"-D FREE\"\n") 25 else: 26 make_script.write ("\t./configure\n") 27 28 make_script.write("\t./build.py\n") 29 make_script.write(""" 30 31 install: 32 ./install.py -d $(DESTDIR) 33 """) 34 35 build_script = open('./build/snapcraft.yaml', 'w+') 36 build_script.write(yaml) 37 38