As stated in the tile, I want to know how should one mark code(functions or pieces of code smaller than 50% of the source file) copied from non copyleft sources (e.g Apache) ?
1 Answer
I do it this way:
- I add a proper Apache notice and copyright at the top of the file
- I document in comments where I took the code from and what I took
- I document in comments any changes I did
- I add a copy of the Apache license to go with the code
- if originally present, I copy and carry with the code any NOTICE-like file that was with the original code
-
1That would be a good solution if you accept that the rest of the file be covered by the Apache license as well. What if you want to put your own changes under a copyleft license, or keep them proprietary?– Zimm i48Feb 23, 2017 at 13:34
-
1@Zimmi48 If your choice of other licenses is compatible with the Apache license (say proprietary or MIT/BSD or L/GPLv3) then you can use the same approach for your code and these other licenses in the same file. e.g. just document each section with a proper notice and comments.Though it is usually saner to split things in different files IMHO. Feb 23, 2017 at 17:48
-
1@PhilippeOmbredanne but then wouldn't it be easier to copy the whole source file containing the Apache license and from your proprietary code just to call the functions/methods you need (of course when no change is required)?– ossxFeb 24, 2017 at 12:26
-
1@florinx: in many cases it would be, but this is not what you asked as a question ;) Feb 24, 2017 at 14:51
-
@PhilippeOmbredanne You are technically right, finally it's about good documentation :)– ossxFeb 24, 2017 at 15:09