-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add meson wrap files for dependencies and more meson fixes
- Loading branch information
Showing
5 changed files
with
82 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/env python3 | ||
###################################################################### | ||
# Wrap an arbitrary file for inclusion in c. | ||
# | ||
# 2024-04-21 Sun | ||
# Dov Grobgeld <dov.grobgeld@gmail.com> | ||
###################################################################### | ||
|
||
import argparse | ||
import re | ||
|
||
def file2c(target, source): | ||
out = open(target, "wb") | ||
inp = open(source, "rb") | ||
|
||
for line in inp.readlines(): | ||
line = line.decode('utf8').rstrip() | ||
line = re.sub("\\\\", "\\\\", line) | ||
line = re.sub("\\\"", "\\\"", line) | ||
line = '"'+line+'\\n"\n' | ||
out.write(line.encode('utf8')) | ||
|
||
out.close() | ||
inp.close() | ||
|
||
parser = argparse.ArgumentParser(description='Process a file') | ||
parser.add_argument('--target', | ||
dest='target', | ||
action='store', | ||
type=str, | ||
default=None, | ||
help='target filename') | ||
parser.add_argument('--source', | ||
dest='source', | ||
action='store', | ||
default=None, | ||
help='source filename editing') | ||
|
||
args = vars(parser.parse_args()) | ||
print(f'{args["target"]=} {args["source"]=}') | ||
if not args['target'] or not args['source']: | ||
sys.write('Need both target asnd source arguments!') | ||
|
||
file2c(args['target'], | ||
args['source']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[wrap-git] | ||
url = http://github.com/dov/gob2 | ||
revision = cpp-new |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[wrap-git] | ||
url = http://github.com/dov/libplis.git | ||
revision = master |