File tree 3 files changed +21
-9
lines changed
3 files changed +21
-9
lines changed Original file line number Diff line number Diff line change 27
27
archiveLockFile ,
28
28
inputOverrides ,
29
29
elispPackagePins ,
30
+ defaultMainIsAscii ,
30
31
} : mode : let
31
32
toLockData = {
32
33
nodes ,
92
93
) ;
93
94
94
95
getPackageData = revDep : ename :
95
- lib . makeExtensible ( import ./package.nix { inherit lib linkFarm ; }
96
+ lib . makeExtensible ( import ./package.nix { inherit lib linkFarm defaultMainIsAscii ; }
96
97
ename
97
98
# It would be nice if it were possible to set the pin from inside
98
99
# overrideInputs, but it causes infinite recursion unfortunately :(
Original file line number Diff line number Diff line change 22
22
isFunction
23
23
;
24
24
in
25
- { lib , linkFarm } : ename : mkAttrs : self : let
25
+ {
26
+ lib ,
27
+ linkFarm ,
28
+ defaultMainIsAscii ,
29
+ } : ename : mkAttrs : self : let
26
30
attrs =
27
31
if isAttrs mkAttrs
28
32
then mkAttrs
63
67
lib . parseElispHeaders
64
68
(
65
69
# Add support for an option to remove IFD.
66
- if self . mainIsAscii or false
70
+ if self . mainIsAscii or defaultMainIsAscii
67
71
then builtins . readFile ( self . src + "/${ self . mainFile } " )
68
72
else
69
73
( lib . readFirstBytes
88
92
# If the source if a single-file archive from ELPA or MELPA, src will be
89
93
# a file, and not a directory, so the file should be put in a directory.
90
94
if attrs . inventory . type == "archive" && attrs . archive . type == "file"
91
- then linkFarm ( ename + ".el" ) [
92
- {
93
- name = ename + ".el" ;
94
- path = attrs . src ;
95
- }
96
- ]
95
+ then
96
+ linkFarm ( ename + ".el" ) [
97
+ {
98
+ name = ename + ".el" ;
99
+ path = attrs . src ;
100
+ }
101
+ ]
97
102
else attrs . src ;
98
103
99
104
files = attrs . files or ( lib . expandMelpaRecipeFiles self . src null ) ;
Original file line number Diff line number Diff line change 36
36
if wantExtraOutputs
37
37
then [ "info" ]
38
38
else [ ] ,
39
+ # Assume the main files of all packages contain only ASCII characters. This is
40
+ # a requirement for avoiding IFD, but some libraries actually contain
41
+ # non-ASCII characters, which cannot be parsed with `builtins.readFile`
42
+ # function of Nix.
43
+ defaultMainIsAscii ? false ,
39
44
# Export a manifest file of of the package set from the wrapper
40
45
# (experimental). Needed if you use the hot-reloading feature of twist.el.
41
46
exportManifest ? false ,
101
106
archiveLockFile
102
107
builtinLibraries
103
108
inputOverrides
109
+ defaultMainIsAscii
104
110
;
105
111
# Just remap the name
106
112
inventories = registries ;
You can’t perform that action at this time.
0 commit comments